package paperfile

import (
	"net/http"

	"paper-pro/app/paperfile/api/internal/logic/paperfile"
	"paper-pro/app/paperfile/api/internal/svc"

	"paper-pro/pkg/result"
)

// upload and parse paper file
func UploadHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		l := paperfile.NewUploadLogic(r.Context(), svcCtx)
		resp, err := l.Upload(r)
		result.HttpResult(r, w, resp, err)
	}
}
